package com.example.maomao.controller;


import com.example.maomao.mapper.AboutMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class XingzhiController {

    @Autowired
    AboutMapper aboutMapper;


    @GetMapping("/xingzhi")
    public String xinzhi(){

        return "xingzhi";
    }

    @PostMapping("/xingzhi")
    public String postxinzhi(@RequestParam(name = "name") String name,
                            @RequestParam(name = "phone") String phone,
                            @RequestParam(name = "message") String message){
        System.out.println(name+phone+message);
        aboutMapper.insertIn(name,phone,message);
        return "xingzhi";
    }


}
